<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>修改用户</title>
<script src="${pageContext.request.contextPath}/static/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/static/bootstrap/2.3.1/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<!--[if lte IE 6]>
<link href="static/bootstrap/bsie/css/bootstrap-ie6.min.css" type="text/css" rel="stylesheet" />
<script src="static/bootstrap/bsie/js/bootstrap-ie.min.js" type="text/javascript"></script>
<![endif]-->
<link href="${pageContext.request.contextPath}/static/jquery-select2/3.4/select2.min.css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/jquery-select2/3.4/select2.min.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/static/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/static/jquery-jbox/2.3/Skins/Bootstrap/jbox.min.css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/static/common/common.css" type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath}/static/common/common.js" type="text/javascript"></script>
<!-- <script type="text/javascript">var ctx = '', ctxStatic='/static';</script> -->
	<script type="text/javascript">
		$(function() {
			$("#no").focus();
			$("#inputForm").validate({
				/* rules: {
					loginName: {remote: "/sys/user/checkLoginName?oldLoginName=" + encodeURIComponent('')}
				}, */
				messages: {
					loginName: {remote: "用户登录名已存在"},
					confirmNewPassword: {equalTo: "输入与上面相同的密码"}
				},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>

</head>
<body>
<ul class="nav nav-tabs">
		<li><a href="${pageContext.request.contextPath}/sys/user.do?method=findUserByPage&tgId=${tgId}&pageNum=1">用户列表</a></li>
		<li class="active">
			<a href="userAdd.html">用户修改
			</a>
		</li>
	</ul><br/>
	<form id="inputForm" class="form-horizontal" action="${pageContext.request.contextPath}/sys/user.do?method=editUser" method="post">
		
				<input type = "hidden" name = "pageNum" value = "1">
				<input type = "hidden" name = "tgId" value = "${tgId}">
		<div class="control-group">
			<label class="control-label">工号:</label>
			<div class="controls">
				<input id="no" name="userid" class="required" type="text" value="${sysUser.userId}" maxlength="50"/>
				<span class="help-inline"><span style="color:red">*</span> </span>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">姓名:</label>
			<div class="controls">
				<input id="name" name="username" class="required" type="text" value="${sysUser.username }" maxlength="50"/>
				<span class="help-inline"><span style="color:red">*</span> </span>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">密码:</label>
			<div class="controls">
				<input id="newPassword" name="newPassword" type="password" value="${sysUser.password }" maxlength="50" minlength="3" class="required"/>
				<span class="help-inline"><span style="color:red">*</span> </span>
				
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">确认密码:</label>
			<div class="controls">
				<input id="confirmNewPassword" name="password" type="password" value="${sysUser.password }" maxlength="50" minlength="3" equalTo="#newPassword"/>
				<span class="help-inline"><span style="color:red">*</span> </span>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">用户角色:</label>
			<div class="controls">
				<c:forEach items="${roleList}" var="role">
				<span><input  
				<c:forEach items="${alreadyHaveRole }" var="rm1">
					<c:if test="${rm1.roleId==role.roleId }" >
						 checked="checked"
					</c:if>
					</c:forEach>
				id="roleIdList1" name="roleIdList" class="required" type="checkbox" value="${role.roleId }"/><label for="roleIdList1">${role.roleName }</label></span>
				</c:forEach>
				
				<span class="help-inline"><span style="color:red">*</span> </span>
			</div>
		</div>
		
	
	
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<textarea id="remarks" name="remarks" maxlength="200" class="input-xlarge" rows="3"></textarea>
			</div>
		</div>
		
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form>












<%-- <form action="${pageContext.request.contextPath}/sys/user.do?method=editUser" method="post">

					
				账号：<input type = "text" name = "userid" value = "${sysUser.userId}"><br>
				密码：<input type = "text" name = "password" value = "${sysUser.password }"><br>
				姓名：<input type = "text" name = "username" value = "${sysUser.username }"><br>
						<input type = "hidden" name = "pageNum" value = "1">
						<input type = "hidden" name = "tgId" value = "${tgId}">
				<input type ="submit" value="修改">
			
		</form> --%>
</body>
</html>